#!/usr/bin/env bash
# MANDATORY_REVIEWERS: airbnb/service-framework
# This script creates a local branch by branching off from a recent master SHA
# for which the Gradle remote cache is still warm. In other words, when you
# build your service, most of the things will be fetched from the remote cache
# rather than rebuilt from scratch locally. This can result in significant
# speedup for large services.

set -euo pipefail

printf "
\e[33m
  This script is no longer needed. You can create local branches from any recent SHA
  on master and get good cache results. This script will be removed by end of 2020.
\e[0m
"

if [ $# -ne 1 ]; then
  echo "Usage: ./new_branch.sh <BRANCH_NAME>"
  exit 1
file file


mainline=master
warm_branch=WARM_MAIN
branch_name=$1

git fetch origin +refs/heads/$warm_branch:refs/remotes/origin/$warm_branch +refs/heads/$mainline:refs/remotes/origin/$mainline
git checkout -b "$branch_name" origin/$warm_branch

ADD 2 LINE
